<!doctype html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <link rel="icon" type="image/svg+xml" href="./src/assets/b20a2c2ba2a0d61d9c056b58bf20a24.png" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
  <title id="name"></title>
</head>
<style>
  body {
    padding: 0;
    margin: 0;
    color: #222;
    /* background: #336FFF; */
  }
  
  /* 禁止双击放大 */
  * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  html, body {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    overflow-x: hidden;
  }
  
  /* 禁用iOS Safari的双击缩放 */
  @media screen and (-webkit-min-device-pixel-ratio: 0) {
    * {
      -webkit-touch-callout: none;
      -webkit-user-select: none;
    }
  }
</style>

<body>
  <div id="app"></div>
  <script type="module" src="/src/main.js"></script>
  
</body>
<script type="module">
  import {configshop} from "./src/api/index";
  import store from "./src/store/index.js";
  
  // 初始化店铺信息
  store.dispatch('initializeShopInfo');
  
  // 从 store 获取店铺名称
  let shopName = store.getters.shopName;
  
  if(shopName){
      document.getElementById('name').textContent = shopName;
  }else{
      configshop().then(res=>{
          document.getElementById('name').textContent = res.data.shop_title;
          // 使用 Vuex store 缓存店铺数据
          store.dispatch('setShopInfo', {
              shopName: res.data.shop_title,
              shopData: res.data
          });
      })
  }

</script>

</html>
